const { connect } = require('mongoose')
const config = require('config')

;(async () => {
  const result = await connect(config.get('db.url').replace('${DB_PWD}', process.env.DB_PWD)).catch(err => err)
  if (result instanceof Error) {
    return console.log(result)
  }
  console.log('db connected...')
})()
